package model

type Inventory struct {
	BaseModel
	Goods   int32 `gorm:"type:int;index"`
	Stocks  int32 `gorm:"type:int"`
	Version int32 `gorm:"type:int"` // 分布式锁的乐观锁
}

type DeliveryHistory struct {
	Goods   int32  `gorm:"type:int;index"`
	Nums    int32  `gorm:"type:int"`
	OrderSn string `gorm:"type:varchar(200)"`
	Status  string `gorm:"type:varchar(200)"` // 1、 代表已扣减 2、表示已支付 3、表示失败
}
type StockSellDetail struct {
	OrderSn string          `gorm:"type:varchar(200);index:idx_order_sn,unique;"`
	Status  string          `gorm:"type:varchar(200)"` // 1、 代表已扣减 2、表示已归还
	Detail  GoodsDetailList `gorm:"type:varchar(200)"`
}

func (StockSellDetail) TableName() string {
	return "stocksellDetail"
}

/*type InventoryHistory struct {
	user   int32
	goods  int32
	nums   int32
	order  int32
	status int32 //1、波阿是库存是预扣减 ，幂等设计 2、表示已经支付
}
*/
